<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="" name="" id="price1" value="" />
		<select name="symbol" id='select_text'>
			<option value ="">挑选符号</option>
			<option value="">+</option>
			<option value="">-</option>
			<option value="">*</option>
			<option value="">/</option>
			<option value="">%</option>
		</select>
		<input type="" name="" id="price2" value="" />
		=
		<input type="" name="" id="price3" value="" />
		<button type="button" onclick="calculate();">计算</button>
	</body>
	<script type="text/javascript">
		function calculate(){
			var pri1 = document.getElementById('price1').value;
			var pri2 = document.getElementById('price2').value;
			// var pri3 = document.getElementById('price3').value;
			var sym = document.getElementById('select_text');
			var GG = sym.selectedIndex;
			var num = 0;
			switch (GG){
				case 0:
					num = '不要选我！';
					document.getElementById('price3').value = num;
					break;
				case 1:
					num = pri1 + pri2;
					document.getElementById('price3').value = num;
					break;
				case 2:
					num = pri1 - pri2;
					document.getElementById('price3').value = num;
					break;
				case 3:
					num = pri1 * pri2;
					document.getElementById('price3').value = num;
					break;
				case 4:
					num = pri1 / pri2;
					document.getElementById('price3').value = num;
					break;
				case 5:
					num = pri1 % pri2;
					document.getElementById('price3').value = num;
					break;
				default:
					break;
			}
			console.log(GG)
		}
	</script>
</html>
